<%=javascript_include_tag "prototype"%>	
<SCRIPT LANGUAGE="VBScript">
on error resume next
If Prototype.Browser.IE Then
  javaws150Installed = (IsObject(CreateObject("JavaWebStart.isInstalled.1.5.0.0")))
  javaws160Installed = (IsObject(CreateObject("JavaWebStart.isInstalled.1.6.0.0")))
End If
</SCRIPT> 
<%=javascript_include_tag "check_jre"%>	
<SCRIPT LANGUAGE="Javascript">
function nojwsnodirect()
{
	if(!javawsInstalled)
	{
		alert("To join the swarm, you have to install the newest Java WebStart!\n After you install it, refresh or restart your browser to continue.");
		window.open("http://jdl.sun.com/webapps/getjava/BrowserRedirect?host=www.java.com:80");
	}
	return javawsInstalled;
}
</SCRIPT> 
<br/><br/>
	<div>
		<font size=4><b>Top ten swarms</b> </font>(click number to join)<br />
		<table>
		<tr><th>No.</th><th>swarm</th><th>users</th></tr>
	<% ind=1%>
	<% @topten_swarm.each do |swarm| %>
	<tr>
	<td align=right><b><%=ind%>.</b></td><td align=center>
	<%= link_to(swarm.title,:controller=>"/swarm",:action=>"show_one",:id=>swarm.url) %>
	</td><td style="text-align:right"><%= link_to CommonUtil.getusersbyid(swarm.id).to_s,{:controller => "webgui",:action=>"index",:server => (request.protocol << request.host_with_port)+"/"+swarm.url},:onclick=>"return nojwsnodirect();" %>
	</td>
	</tr>
	<% ind=ind+1%>
	<%end%>
		</table>
	</div>
